package com.xiguaji.boot.retry;

import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Component;

@Component
public class RetryService {
    private static int i = 0;

    @Retryable(value = RetryableException.class)
    public void print() {
        System.out.println("111");
        if (i < 2) {
            i++;
            throw new RetryableException("hahaha");
        }
    }

}
